<div class="page-header">
	<h1>抓取页面请求&nbsp;<small>Fetch</small></h1>
    <p class="well">本例使用chrome的内置开发工具抓取页面请求</p>
</div>
            <section>
            	<table id="request-list" class="table table-bordered table-striped table-condensed">
                	<thead>
                    	<tr>
                        	<th></th>
                        	<th>Name</th>
                            <th>Method</th>
                            <th>Status</th>
                            <th>Type</th>
                            <th>Size</th>
                            <th>Time</th>
                        </tr>
                    </thead>
                    <tbody>
                    	<tr class="info">
                        	<td><a class="btn btn-mini disabled" href="#1-http-request" onclick="return false;"><i class="icon-search"></i></a></td>
                            <td>login</td>
                            <td>POST</td>
                            <td>200</td>
                            <td>application/json</td>
                            <td>395B</td>
                            <td>37ms</td>
                        </tr>
                        <tr>
                        	<td><a class="btn btn-mini" href="#2-http-request" onclick="return false;"><i class="icon-search"></i></a></td>
                            <td>dashboard</td>
                            <td>GET</td>
                            <td>200</td>
                            <td>text/html</td>
                            <td>8.98KB</td>
                            <td>27ms</td>
                        </tr>
                        <tr>
                        	<td></td>
                            <td>static.wo-api.com?2.2.1</td>
                            <td>GET</td>
                            <td>304</td>
                            <td>application/x-javascript</td>
                            <td>(from cache)</td>
                            <td>0ms</td>
                        </tr>
                    </tbody>
                </table>
            </section>
            <section id="http-request">
            <div class="request-holder" id="1-http-request">
            	<ul class="nav nav-tabs">
                	<li class="active"><a href="#1-headers" data-toggle="tab">Headers</a></li>
                    <li><a href="#1-response" data-toggle="tab">Response</a></li>
                    <li><a href="#1-cookies" data-toggle="tab">Cookies</a></li>
                </ul>
                <div class="tab-content">
                	<div class="tab-pane active" id="1-headers">
                    	<pre class="prettyprint linenums">
Request URL:http://localhost:84/api/account/login
Request Method:POST
Status Code:200 OK

[Request Headers]
Accept:application/json, text/javascript, */*; q=0.01
Accept-Charset:UTF-8,*;q=0.5
Accept-Encoding:gzip,deflate,sdch
Accept-Language:zh-CN,zh;q=0.8
Connection:keep-alive
Content-Length:40
Content-Type:application/x-www-form-urlencoded; charset=UTF-8
Cookie:PHPSESSID=j82ktk5h2u6ssakat7do9j8gn5
Host:localhost:84
Origin:http://localhost:84
Referer:http://localhost:84/dashboard/account/login
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17
X-Requested-With:XMLHttpRequest

username:duanchi@dev
password:xxxx


[Response Headers]
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:keep-alive
Content-Type:text/html
Date:Wed, 06 Feb 2013 02:31:05 GMT
Dump-Runtime:33.3 ms
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Pragma:no-cache
Server:nginx/1.2.6
Transfer-Encoding:chunked
X-Powered-By:PHP/5.4.11
                        </pre>
                    </div>
                	<div class="tab-pane" id="1-response">
                		<pre class="prettyprint linenums">
{
	"status":true,
    "message":"LOGIN_SUCCESSFUL"
}</pre>
                	</div>
                    <div class="tab-pane" id="1-cookies">
                		<pre>
                        <table class="table table-striped table-condensed">
                        	<thead>
                                <tr>
                                    <th>Name</th>
                                    <th>Value</th>
                                    <th>Domain</th>
                                    <th>Path</th>
                                    <th>Expires</th>
                                    <th>Size</th>
                                    <th>Http</th>
                                    <th>Secure</th>
                                </tr>
                                <tr>
                                	<th colspan="8">Request Cookies</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>PHPSESSID</td>
                                    <td>j82ktk5h2u6ssakat7dS9j8gn5</td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td>36</td>
                                    <td></td>
                                    <td></td>
                                </tr>
                            </tbody>
                            <thead>
                                <tr>
                                	<th colspan="8">Response Cookies</th>
                                </tr>
                            </thead>
                        </table>
                        </pre>
                	</div>
                </div>
            </div>
            <div class="request-holder hide" id="2-http-request">
            	<ul class="nav nav-tabs">
                	<li class="active"><a href="#2-headers" data-toggle="tab">Headers</a></li>
                    <li><a href="#2-response" data-toggle="tab">Response</a></li>
                    <li><a href="#2-cookies" data-toggle="tab">Cookies</a></li>
                </ul>
                <div class="tab-content">
                	<div class="tab-pane active" id="2-headers">
                    	<pre class="prettyprint linenums">
Request URL:http://localhost:84/dashboard
Request Method:GET
Status Code:200 OK

[Request Headers]
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:UTF-8,*;q=0.5
Accept-Encoding:gzip,deflate,sdch
Accept-Language:zh-CN,zh;q=0.8
Connection:keep-alive
Cookie:PHPSESSID=j82ktk5h2u6ssakat7do9j8gn5
Host:localhost:84
Referer:http://localhost:84/dashboard/account/login
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17


[Response Headers]
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:keep-alive
Content-Type:text/html
Date:Wed, 06 Feb 2013 02:31:05 GMT
Dump-Runtime:23.7 ms
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Pragma:no-cache
Server:nginx/1.2.6
Transfer-Encoding:chunked
X-Powered-By:PHP/5.4.11
                        </pre>
                    </div>
                	<div class="tab-pane" id="2-response">
                		<pre class="prettyprint linenums lang-html">
&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset="UTF-8"&gt;
&lt;title&gt;Dashboard&lt;/title&gt;
&lt;link rel="stylesheet" href="http://static.wo-api.com/bootstrap/css/?2.2.1" /&gt;
&lt;link rel="stylesheet" href="/static/theme/bootstrap/css/dashboard/common.css" /&gt;
&lt;link rel="stylesheet" href="/static/theme/bootstrap/css/dashboard/index.css" /&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;div class="navbar navbar-fixed-top navbar-inverse"&gt;
	&lt;div class="navbar-inner"&gt;
    	&lt;div class="container"&gt;
        	&lt;a class="brand" href="#"&gt;Push! &middot; Dashboard&lt;/a&gt;
        	&lt;ul class="nav pull-right"&gt;
            	&lt;li class="dropdown"&gt;
                	&lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"&gt;断翅@测试域名&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
                	&lt;ul class="dropdown-menu"&gt;
                    	&lt;li&gt;&lt;a href="#"&gt;用户设置&lt;/a&gt;&lt;/li&gt;
                        &lt;li&gt;&lt;a href="#"&gt;帮助&lt;/a&gt;&lt;/li&gt;
                        &lt;li class="divider"&gt;&lt;/li&gt;
                        &lt;li&gt;&lt;a href="/dashboard/account/logout"&gt;注销&lt;/a&gt;&lt;/li&gt;
                    &lt;/ul&gt;
                &lt;/li&gt;
            &lt;/ul&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;div class="container"&gt;
	&lt;div class="row row-fluid"&gt;
    	&lt;div id="option-menu" class="span3 well"&gt;
        	&lt;ul class="nav nav-list"&gt;
            	&lt;li class="nav-header"&gt;&lt;h5&gt;分类管理&lt;/h5&gt;&lt;div class="add-on-btn"&gt;&lt;i data-toggle="modal" data-target="#modal-add-top-category" class="icon-plus"&gt;&lt;/i&gt;&lt;/div&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href="/dashboard?category=1"&gt;测试&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href="/dashboard?category=2"&gt;&nbsp;-&nbsp;test_cal&lt;/a&gt;&lt;/li&gt;
                &lt;li class="divider"&gt;&lt;/li&gt;
                &lt;li class="nav-header"&gt;其他操作&lt;/li&gt;
            &lt;/ul&gt;
        &lt;/div&gt;
        &lt;div class="span9 well"&gt;
&lt;div class="alert alert-info"&gt;&lt;h4&gt;提示:&lt;/h4&gt;&lt;br /&gt;请在左侧菜单选择分类操作.&lt;/div&gt;        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div&gt;&copy; 2013&lt;/div&gt;
&lt;/div&gt;
&lt;!-- 添加顶级分类modal --&gt;
&lt;div id="modal-add-top-category" class="modal hide fade"&gt;
	&lt;div class="modal-header"&gt;
    	&lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&times;&lt;/button&gt;
        &lt;h3&gt;Modal header&lt;/h3&gt;
    &lt;/div&gt;
    &lt;div class="modal-body"&gt;
    	&lt;form class="form-horizontal" aciton="/api/category/add"&gt;
        	&lt;div class="control-group"&gt;
            	&lt;label class="control-label" for="name"&gt;分类名称&lt;/label&gt;
                &lt;div class="controls"&gt;&lt;input type="text" id="name" name="name" /&gt;&lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="control-group"&gt;
            	&lt;label class="control-label" for="sub_name"&gt;分类副名称&lt;/label&gt;
                &lt;div class="controls"&gt;&lt;input type="text" id="sub_name" name="sub_name" /&gt;&lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="control-group"&gt;
            	&lt;label class="control-label" for="description"&gt;分类说明&lt;/label&gt;
                &lt;div class="controls"&gt;&lt;input type="text" id="description" name="description" /&gt;&lt;/div&gt;
            &lt;/div&gt;
        &lt;/form&gt;
    &lt;/div&gt;
    &lt;div class="modal-footer"&gt;
    	&lt;a href="#" data-dismiss="modal" class="btn"&gt;取消&lt;/a&gt;
        &lt;a href="#" class="btn btn-primary"&gt;确认添加&lt;/a&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;script type="text/javascript" src="http://static.wo-api.com/jquery/?1.9.0"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="http://static.wo-api.com/bootstrap/js/?2.2.1"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/static/theme/bootstrap/js/dashboard/common.lib.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/static/theme/bootstrap/js/dashboard/common.action.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/static/theme/bootstrap/js/dashboard/index.js"&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
                	</div>
                    <div class="tab-pane" id="2-cookies">
                		<pre>
                        <table class="table table-striped table-condensed">
                        	<thead>
                                <tr>
                                    <th>Name</th>
                                    <th>Value</th>
                                    <th>Domain</th>
                                    <th>Path</th>
                                    <th>Expires</th>
                                    <th>Size</th>
                                    <th>Http</th>
                                    <th>Secure</th>
                                </tr>
                                <tr>
                                	<th colspan="8">Request Cookies</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>PHPSESSID</td>
                                    <td>j82ktk5h2u6ssakat7dS9j8gn5</td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td>36</td>
                                    <td></td>
                                    <td></td>
                                </tr>
                            </tbody>
                            <thead>
                                <tr>
                                	<th colspan="8">Response Cookies</th>
                                </tr>
                            </thead>
                        </table>
                        </pre>
                	</div>
                </div>
            </div>
            </section>
<div id="manual-pagination" class="btn-group">
	<a class="btn" href="/manual/development/directory">&laquo;&nbsp;目录结构</a>
    <a class="btn" href="/manual/development/config">配置文件&nbsp;&raquo;</a>
</div>
<style>
#http-request .nav-tabs { margin-bottom:0;}
#http-request .tab-content pre { border-top:0 none; border-top-left-radius:0; border-top-right-radius:0; background:#fff; height:300px; overflow-y:auto;}
</style>
{literal}<script type="text/javascript">
$(function(){
	$('#request-list td a').on('click',function(){
		$('#request-list td a').removeClass('disabled');
		$('#request-list tbody tr').removeClass('info');
		$(this).parent().parent().addClass('info');
		$(this).addClass('disabled');
		$('.request-holder').addClass('hide');
		$($(this).attr('href')).removeClass('hide');
		return false;
	});
});
</script>{/literal}